/*** 本文件由CSMIS2.0-ModelCreater(UTF-8)工具辅助生成，版本1.0 ***/

package com.ce.sys.menu.logic.search;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.ce.framework.datamaintain.logic.ISQLMapper;
import com.ce.framework.datamaintain.logic.SQLSearchCondition;
import com.ce.framework.exception.AppException;
import com.ce.sys.menu.view.SysMenuOperationsView;

/**
* 嫦娥软件有限公司 版权所有 2013
* 创建人：　andy
* 创建日期：2010-10-11
* 创建时间：13:31:35
* 功能描述：操作功能表 [SYS_T_MENU$OPERATIONS]条件过滤类
* ==============================================
* 修改历史
* 修改人		修改时间		修改原因
*
* ==============================================
*/
public class SysMenuOperationsSearchCondition  extends SQLSearchCondition
	implements ISQLMapper
{

   private String menuId;

   public String getMenuId() {
	return menuId;
   }

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public String getSearchSql() throws AppException {
		
		String sql = "select * from SYS_T_MENU$OPERATIONS t where t.VC_DEL$FLAG = 0 and t.VC_MENU$ID = '"+this.getSafeValue(this.menuId)+"' order by t.N_SEQ";
		return sql;
	}
	
	public Object fromSQLQuery(ResultSet rs, int num) {
		SysMenuOperationsView view = new SysMenuOperationsView();
		try {

			view.setVcId(rs.getString("VC_ID"));
			view.setVcMenuId(rs.getString("VC_MENU$ID"));
			view.setVcName(rs.getString("VC_NAME"));
			view.setVcSimpleName(rs.getString("VC_SIMPLE$NAME"));
			view.setVcFunname(rs.getString("VC_FUNNAME"));
			view.setVcIdname(rs.getString("VC_IDNAME"));
			view.setNseq(rs.getInt("N_SEQ"));
			view.setVcFlag(rs.getString("VC_FLAG"));
			view.setVcShow(rs.getString("VC_SHOW"));
			view.setVcIco(rs.getString("VC_ICO"));
			view.setVcDelFlag(rs.getInt("VC_DEL$FLAG"));			

		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		return view;
	}
	
	public ISQLMapper getSQLMapper() {
		
		return this;
	}

}

